package com.iseastar.guojiang.model;

import java.util.ArrayList;
import java.util.HashMap;

/**
 * http接口解析
 *
 * @param <T>2015-4-17下午6:26:22
 * @author coffee<br>
 */
public class ReqResult<T> {

    private int status;
    private String message = "服务器异常";
    private T result;
    private ArrayList<T> resultList;// 结果列表
    private HashMap<String, T> resultMap;//返回map类型

    // 分页
    private int pageNum = 1; // 当前页码
    private int pageSize = 1;// 分页大小
    private int total = 1;// 数据表的所有数据条数
    private int totalPage = 1;// 总页数

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getResult() {
        return result;
    }

    public void setResult(T result) {
        this.result = result;
    }

    public boolean isSuccess() {
        return this.status == 1;
    }

    public ArrayList<T> getResultList() {
        if (resultList == null) {
            resultList = new ArrayList<T>();
        }
        return resultList;
    }

    public void setResultList(ArrayList<T> resultList) {
        this.resultList = resultList;
    }

    public HashMap<String, T> getResultMap() {
        return resultMap;
    }

    public void setResultMap(HashMap<String, T> resultMap) {
        this.resultMap = resultMap;
    }
}
